home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectMusic / PlayAudio / readme.txt < prev    next >
Text File  |  2001-10-10  |  4KB  |  81 lines

  1. //-----------------------------------------------------------------------------
  2. // 
  3. // Sample Name: VB PlayAudio Sample
  4. // 
  5. // Copyright (C) 1999-2001 Microsoft Corporation. All rights reserved.
  6. //
  7. // GM/GS« Sound Set Copyright ⌐1996, Roland Corporation U.S.
  8. // 
  9. //-----------------------------------------------------------------------------
  10.  
  11.  
  12. Description
  13. ===========
  14.   The PlayAudio sample shows how to load a segment and play it on an 
  15.   audiopath, how to use DirectMusic notifications, and how to change 
  16.   global performance parameters.
  17.   
  18. Path
  19. ====
  20.   Source: DXSDK\Samples\Multimedia\VBSamples\DirectMusic\PlayAudio
  21.  
  22.   Executable: DXSDK\Samples\Multimedia\VBSamples\DirectMusic\Bin
  23.  
  24. User's Guide
  25. ============
  26.   Play the default segment, or load another wave, MIDI, or DirectMusic 
  27.   Producer segment file by clicking Audio File. Adjust the tempo and 
  28.   volume by using the sliders
  29.   
  30. Programming Notes
  31. =================
  32.   This is how the sample works:
  33.   
  34.   * Upon Form_Load
  35.         1. Create the DirectMusic objects.  
  36.         2. Initialize DirectMusic.  This creates a default standard audio path
  37.         3. Call DirectMusicPerformance8.AddNotificationType passing in 
  38.            DMUS_NOTIFY_ON_SEGMENT. This will make DirectMusic tell us about any 
  39.            segment notifications that come in.  This is needed to by this
  40.            sample to know when the segment has ended.  However DirectMusic
  41.            games may not care when the segment has ended.           
  42.         4. Create a DirectX event, dmEvent.  This will be used by DirectMusic
  43.            to signal the app whenever a DirectMusic notification comes in.
  44.         5. Call DirectMusicPerformance8.SetNotificationHandle passing
  45.            in the DirectX event, dmEvent.  This tells DirectMusic
  46.            to signal this event when a notification is available.
  47.  
  48.   * When "Open File" is clicked.  See cmdOpen_Click()
  49.         1. Get the file name from the common dialog.
  50.         2. Get rid of any old segment.
  51.         3. Call DirectMusicLoader8.SetSearchDirectory.
  52.            This will tell DirectMusic where to look for files that 
  53.            are referenced inside of segments.
  54.         4. Call DirectMusicLoader8.LoadSegmentFromFile
  55.     5. If the file is a pure MIDI file then it calls 
  56.        DirectMusicSegment8.SetStandardMidiFile This makes 
  57.            sure that patch changes are handled correctly.
  58.     6. Calls DirectMusicSegment8.Download
  59.            this will download the segment's bands to the synthesizer.  
  60.            Some apps may want to wait before calling this to because 
  61.            the download allocates memory for the instruments. The 
  62.            more instruments currently downloaded, the more memory 
  63.            is in use by the synthesizer.
  64.                   
  65.    * When "Play" is clicked.  See cmdPlay_Click()
  66.         1. If the UI says the sound should be looped, then call 
  67.            DirectMusicSegment8.SetRepeats passing in INFINITE,
  68.            otherwise call DirectMusicSegment8.SetRepeats passing in 0.
  69.         2. Call DirectMusicPerformance8.PlaySegmentEx() 
  70.         
  71.    * Upon a DirectMusic notification. See DirectXEvent8_DXCallback().
  72.         This sample wants to know if the primary segment has stopped playing
  73.         so it can updated the UI so tell the user that they can play 
  74.         the sound again. 
  75.         
  76.         1. Call IDirectMusicPerformance8.GetNotificationPMSG 
  77.         2. Switch off the pPMsg->dwNotificationOption.  This sample 
  78.            only handles it if its a DMUS_NOTIFICATION_SEGEND.  This tells 
  79.            us that segment has ended.
  80.         
  81.